/*
* This file is a part of the open-eBackup project.
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at
* http://mozilla.org/MPL/2.0/.
*
* Copyright (c) [2024] Huawei Technologies Co.,Ltd.
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
*/
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "mockcpp/mockcpp.hpp"
#include "gmock/gmock-actions.h"
#include "CommonJobFactory.h"

using namespace Module;
using namespace AppProtect;
using namespace std;
using namespace AppServiceExport;

class CommonJobFactoryTest : public testing::Test {
public:
    void SetUp() {};
    void TearDown() {};
};

/*
 * 用例名称：获取备份实例成功
 * 前置条件：无
 * check点：实例指针是否为非空
 **/
TEST_F(CommonJobFactoryTest, CreateBackupJobSuccess)
{
    auto jobFactory = CommonJobFactory::GetInstance();
    ASSERT_NE(jobFactory, nullptr);
    auto data = std::make_shared<AppProtect::BackupJob>();
    ASSERT_NE(data, nullptr);
    data->jobParam.backupType == AppProtect::BackupJobType::FULL_BACKUP;
    auto jobInfo = std::make_shared<JobCommonInfo>(data);
    auto jobPtr = jobFactory->CreateJob(jobInfo, JobType::BACKUP);
    EXPECT_NE(jobFactory, nullptr);
}
